{# this is what activated users see #}

{{ hook('publish_before_embed', chart, user) }}

{% if user.mayPublish(chart) %}

    {{ svelte('publish_old', svelte_data) }}

{% else %}

    {% if has_hook('publish_custom_page_not_allowed') %}

        {{ hook('publish_custom_page_not_allowed', user, chart) }}

    {% else %}
        {# core message for being unable to publish #}
        <h2>Unfortunately, you are not allowed to publish.</h2>

    {% endif %}

{% endif %}

{{ hook('publish_after_embed', chart, user) }}


<div class="export-and-duplicate">

    {% if has_hook('publish_custom_export_actions_header') %}

        {{ hook('publish_custom_export_actions_header') }}

    {% else %}
        <h2 class="pad-top">{% trans "publish / export-duplicate" %}</h2>
        <p>{% trans "publish / export-duplicate / intro" %}</p>
    {% endif %}

    <ul class="chart-actions">
    {% for action in chartActions %}

        {% if action %}
        <li class="action action-{{ action.id }}{% if action.class %} {{ action.class }}{% endif %}"{% if action.data %}{% for k,v in action.data %}data-{{ k }}="{{ v }}"{% endfor %}{% endif %}>
            <a role="button" href="{% if action.url %}{{ action.url }}{% else %}#{{ action.id }}{% endif %}">
                <i class="fa fa-{{ action.icon }}"></i><span class="title">{{ action.title | raw }}</span>
            </a>
            {% if action.banner and action.banner.text != "FALSE" and action.banner.text != "-" %}
            <div class="banner" style="{{ action.banner.style }}">{{ action.banner.text }}</div>
            {% endif %}
        </li>
        {% endif %}

    {% endfor %}
    </ul>

    {{ hook('publish_after_chart_actions', chart, user) }}

</div>

